import java.sql.*;

public class TestProc {
	public static void main(String[] args) {
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:lovemanai","scott", "tiger");
			CallableStatement cStat = conn.prepareCall("{call p(?, ?, ?, ?)}");
			cStat.registerOutParameter(3, Types.INTEGER);
			cStat.registerOutParameter(4, Types.INTEGER);
			cStat.setInt(1, 3);
			cStat.setInt(2, 4);
			cStat.setInt(4, 5);
			cStat.execute();
			System.out.println(cStat.getInt(3));
			System.out.println(cStat.getInt(4));
		} catch(ClassNotFoundException e) {
			System.out.println("没有找到相应驱动");
		} catch(SQLException e) {
			e.printStackTrace();
		}
	}
}
